retour/
util.rs

1use crate::error::Result;
2
3/// Returns true if an address is executable.
4pub fn is_executable_address(address: *const ()) -> Result<bool> {
5  Ok(
6    region::query(address as *const _)?
7      .protection()
8      .contains(region::Protection::EXECUTE),
9  )
10}